<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>ProjectBase</title>
        <link rel="StyleSheet" type="text/css" href="styles.css" />
    </h:head>
    <h:body>
        <h1>ProjectBase</h1>
        <h2>Projects</h2>
        <h:form>
	        <p:dataTable value="#{projectBean.projects}" var="project" rendered="#{not empty projectBean.projects}" styleClass="table">
	            <p:column style="width: 25%">
	                <f:facet name="header">
	                    <h:outputText value="Code" />
	                </f:facet>
	                <h:commandLink value="#{project.code}" action="#{projectBean.edit}" ajax="false">
	                    <f:setPropertyActionListener target="#{projectBean.project}" value="${project}" />
	                </h:commandLink>
	            </p:column>
	            <p:column>
	                <f:facet name="header">
	                    <h:outputText value="Name" />
	                </f:facet>
	                <h:outputText value="#{project.name}" />
	            </p:column>
	        </p:dataTable>
	        <h:outputText value="No projects defined." rendered="#{empty projectBean.projects}" />
	        <br />
            <p:commandButton value="Add Project" action="#{projectBean.add}" ajax="false" />
	    </h:form>
    </h:body>
</html>
